<?php
/**
 * Created by PhpStorm.
 * User: renshan
 * Date: 16-6-18
 * Time: 下午9:27
 */

namespace UserBundle\Service;

use Symfony\Component\DependencyInjection\ContainerInterface;

class LoadUserByApiTokenService
{
    protected $container;

    public function __construct(ContainerInterface $container)
    {
        $this->container = $container;
    }

    public function loadUser($api_token)
    {
        return $this->container->get('Doctrine')->getRepository("UserBundle:User")->loadUserByApiToken($api_token);
    }
}